import { request } from '@/service/request'

// 假设你的 API 路径以 '/api' 开头
const BASE_PATH = '/mock'

export const authApi = {
  login: async (username: string, password: string): Promise<{ user: User; token: string }> => {
    const response = await axios.post(`${API_URL}/login`, { username, password })
    return response.data
  },

  logout: async (): Promise<void> => {
    await axios.post(`${API_URL}/logout`)
  },

  getUserInfo: async (): Promise<User> => {
    const response = await axios.get(`${API_URL}/user`)
    return response.data
  }
}
